import sys
from PyQt6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton

class MyMainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('MyMainWindow')
        self.button = QPushButton('Click Me',self)
        self.button.clicked.connect(self.the_button_was_clicked)
        self.setFixedSize(300, 200)
        self.setCentralWidget(self.button)
        
        
    def the_button_was_clicked(self):
        print('Clicked')

def widgetDemo():
    app = QApplication(sys.argv)
    w = QWidget()
    # w.resize(600, 300)
    # w.move(300, 300)
    w.setWindowTitle('Widget')
    w.show()
    app.exec_()

def mainWindowDemo():
    app = QApplication(sys.argv)
    mainWindow = QMainWindow()
    mainWindow.show()
    mainWindow.resize(600, 500)
    mainWindow.setWindowTitle('MainWindow')
    app.exec_()

def MyMainWindowDemo():
    app = QApplication(sys.argv)
    mainWindow = MyMainWindow()
    mainWindow.show()
    app.exec_()

if __name__ == '__main__':
    # widgetDemo()
    # mainWindowDemo()
    MyMainWindowDemo()



